// GetWindowInfo.h: interface for the CGetWindowInfo class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GETWINDOWINFO_H__EAFAE1AE_C2C5_4CC6_BAE6_1ABEC9230EB6__INCLUDED_)
#define AFX_GETWINDOWINFO_H__EAFAE1AE_C2C5_4CC6_BAE6_1ABEC9230EB6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define BUFFER_SIZE 200

class CZWinInfo
{

public:
	CZWinInfo()
	{
		hWnd = NULL;
		memset(szWindowCaption, 0, 200);
	};

	char szWindowCaption[BUFFER_SIZE];

	char szWindowClassName[BUFFER_SIZE];
	HWND hWnd;
};

class CGetWindowInfo  
{
public:
	CGetWindowInfo();
	virtual ~CGetWindowInfo();

	int GetWindowFromCursorInfo();
	int EraseLastWindow();
	void Reset();

	CZWinInfo m_WinInfo;

private:
	int GetControlText(char *pszText, int nSize, HWND hWndControl);
	CWnd m_wndWindow;

	int GetRealWindow(HWND *phWnd, POINT ptPoint);
	int GetWindowFromCursorPos(HWND *phWnd);

	int DrawWindowFrame(HWND hWnd);
	int RedrawWindowFrame(HWND hWnd);

	int FillWindowInfo(HWND hWnd, CZWinInfo &WinInfo);
};


#endif // !defined(AFX_GETWINDOWINFO_H__EAFAE1AE_C2C5_4CC6_BAE6_1ABEC9230EB6__INCLUDED_)
